<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>自动售货机购物车</title>

<script type="text/javascript" src="../js/jquery.js"></script>
<script type="text/javascript" src="../js/jquery.form.js"></script>
<script type="text/javascript">
	
</script>

<style type="text/css">

table {
	border-collapse: collapse;
	border-spacing: 0px;
	
}
table th{
	line-height: 36px;
	padding: 0px 10px;
	color: #999999;
	font-weight: normal;
	text-align: left;
	border: solid 1px #e6e4e3;
	background-color: #fafafa;
}
table tr{
    border: solid 1px #e6e4e3;
}
table td{
	border: solid 1px #e6e4e3;
}
#submit{
	padding: 25px;
	color: #ffffff;
	background-color: #b31d04;
}
#clear{
	margin-right: 10px;
}

.bottom{
	height: 30px;
	width:640px;
	line-height: 30px;
	margin-bottom: 10px;
	overflow: hidden;
	border: solid 1px #e6e4e3;
	background-color: #fafafa;
}
.total{
	padding: 10px 0px;
	margin-bottom: 10px;
	text-align: right;
}

.total em{
	margin-right: 14px;
	color: #ff6600;
	font-style: normal;
}

.total strong{
	color: #ef0101;
    font-size: 14px;
}

.cart {
	width: 130px;
	height: 50px;
	_display: inline;
	float: left;
	padding-left: 30px;
	margin-left: 80px;
	margin-bottom: 4px;	
	float: rigth;
}
.cart1{
	width: 50px;
	height: 50px;
	color:red;
	line-height: 28px;
	_display: inline;
	float: left;
	padding-left: 30px;
	margin-left: 80px;
	margin-bottom: 4px;
}

</style>
<%
String mid = (String)application.getAttribute("cmid");
String cid = (String)application.getAttribute("getcid"); 
System.out.print("在购物车中的首页mid："+mid);
%>
</head>
<body style="max-width: 900px; font-size: 12px;text-align: " >

	<link href="../apage/index5_files/supermarket.min.827f444e.css" type="text/css" rel="stylesheet">

	<div class="head_nav"></div>
	<div id="index_cover" class="index_cover hide"></div>
	<div id="wd_show1" style="width: 900px">
		<div id="common_hd1" class="weidian_default" style="padding-left: 0px;height: 80px;width: 900px;">
			<!--  
			<a id="common_hd_logo" class="t_hide abs common_hd_logo_noBack">卓实</a>
			-->
			<img src="../image/logo.jpg" alt="卓实" style="width: 250px;height: 80px;float: left;" />
						
			<div class="cart" style="float: right;line-height: 75px">	
				<a href="${pageContext.request.contextPath}/acart/cart.jsp">
					<img src="../image/png-0621.jpg"  style="width: 50px;height: 50px"/>			
					<font size="5px" style="line-height: 50px">购物车</font>
				</a>
			</div>	
			<div class="font2" style="float: right;line-height: 100px">
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				<font size="5px" >|</font></a>		
			</div>
			
			<div class="cart1" style="float: right;line-height: 100px">					
				<a href="${pageContext.request.contextPath}/CommodityListServlet?mid=<%=mid%>&cid=<%=cid%>"><font size="5px">首页</font></a>		
			</div>	
		</div>

		<div class="headerxm">
			 	
			 <!--  		
			<div class="avatar" style="width: 130px">
				<img src="../image/logo.jpg" alt="店铺头像" style="width: 130px;height: 50px" />
			</div>
			-->
			<div class="custom-bar">
				<h2 class="shop-name">自动售货机</h2>
				<div class="hd_note_wrap">
					<marquee>
						<p id="" style="animation-duration: 20s;">
							<font size="3px"><b>如果不显示列表，请您到首页，点击购物车再次进入!</b></font>
						</p>
					</marquee>
				</div>
			</div>
		</div>
		<br>
		
		<div align="center" style="height: 100%">
			<table style="width:900px;height: 100%">
				<tbody>
					<tr>
						<th>图片</th>
						<th>商品</th>
						<th>价格</th>
						<th>数量</th>
						<th>小计</th>
						<th>操作</th>
					</tr>	
								
					<c:forEach items="${list}" var="li">					
						<tr style="height: 100px">
							<td width="100">
								<img src="${pageContext.request.contextPath}/${li.goods.imgpath}" style="width: 90px;height: 100px">
							</td>
							<td>
								<font size="5px">
									<a target="_blank">${li.goods.name }</a>
								</font>
							</td>
							<td>
								<font size="5px">
									￥${li.goods.price }
								</font>
							</td>
							<td class="quantity" width="60">
								<font size="5px">
									${li.count}
								</font>
							</td>
							<td width="140">
								<font size="5px">
									<span class="subtotal">￥${li.subtotal}</span>
								</font>
							</td>
							<td>
								<font size="5px">
									<a href="${pageContext.request.contextPath }/RemoveCartServelt?gid=${li.goods.id}" class="delete">删除</a>
								</font>
							</td>
						</tr>
					
					</c:forEach>
				</tbody>
			</table>			
		</div>		
				
		<div class="total">
			<span>${a}</span>
			<em id="promotion"></em>
			<em>登录后确认是否享有优惠</em>
			赠送积分: <em id="effectivePoint">${abc}</em>
			商品金额:<strong id="effectivePrice">${abc}</strong>
			
		</div>
			
		<div class="bottom" align="right" style="width: 900px;height: 50px;line-height: 50px">
			<a href="${ pageContext.request.contextPath }/ClearCartServlet" id="clear" class="clear"><font size="5px">清空购物车</font></a>
			<%-- <a href="../azhifu/CSSuccess.jsp?price=${abc}" id="submit" class="submit">去支付</a>--%>
			<a href="../azhifu/zhifu.jsp?price=${abc}&money=${money}" id="submit" class="submit"><font size="5px">去支付</font></a>
		</div>
	</div>

</body>
</html>